package com.eastcom.bm.dao.impl;

import java.util.ArrayList;
import java.util.List;

import com.eastcom.bm.atom.Atom_NeSpecialThreadhold;
import com.eastcom.bm.dao.AbstractDAO;
import com.eastcom.bm.dao.INeSpecialThreadHoldDao;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.common.db.ResultData;


public class NeSpecialThreadHoldDao extends AbstractDAO implements INeSpecialThreadHoldDao {

	public List<Atom_NeSpecialThreadhold> getAllNeSpecialThreadhold()throws Exception {
		// TODO Auto-generated method stub
		try{
			List<Atom_NeSpecialThreadhold> results=new ArrayList<Atom_NeSpecialThreadhold>();
			
			String sql="select id, kpi_id, ne_id, validation_type, baseline_value ," +
					"deviation_up ,deviation_down ,threadhold_up,threadhold_down,calendar_policy_uuid " +
					"from qa_kpi_ne_special_threadhold";
			
			ResultData rd=JDBCTemplate.executeSQLQuery(sql, JDBCTemplate.PROPAGATION_NEVER, false, false);
			while(rd.next()){
				Atom_NeSpecialThreadhold specialThresHold=new Atom_NeSpecialThreadhold();
				specialThresHold.setId(rd.getString("ID"));
				specialThresHold.setKpiId(rd.getString("KPI_ID"));
				specialThresHold.setNeId(rd.getString("NE_ID"));
				specialThresHold.setValidationType(rd.getString("VALIDATION_TYPE"));
				specialThresHold.setBaselineValue(rd.getDouble("BASELINE_VALUE"));
				specialThresHold.setDeviationUp(rd.getDouble("DEVIATION_UP"));
				specialThresHold.setDeviationDown(rd.getDouble("DEVIATION_DOWN"));
				specialThresHold.setThreadHoldUp(rd.getDouble("THREADHOLD_UP"));
				specialThresHold.setThreadHoldDown(rd.getDouble("THREADHOLD_DOWN"));
				specialThresHold.setCalendarPolicyUUID(rd.getString("CALENDAR_POLICY_UUID"));
				
				results.add(specialThresHold);
			}
			
			return results;
		}
		catch(Exception e){
			throw e;
		}
	}

}
